\section{mod --- Remainder after division}
\label{fn:mod}
\index{mod()}
\index{division!modulo}
\index{remainder after division}
\begin{rail}
Mod : 'mod' '(' (( Scalar ',' Scalar ) | ( Matrix ',' Matrix )) ')' ;
\end{rail}

\verb+mod+ returns the floating point remainder of the
division of the first argument by the second argument.
If the divisor is zero or if the division would overflow, then it returns
zero. When the arguments \verb+mod+ are both matrices, then an
element by element operation is performed, so they must have the
same dimensions.


\paragraph{Example}
\index{example of mod()}
\index{mod()!example}
\begin{verbatim}
> mod(7,2)
        1
> mod(8,3)
        2
> mod(17,6)
        5
> mod(18,6)
        0
> Mat1 = round(rand(2,5)*100)
 Mat1 =
       65         91         30         70          9  
       13         11         27         95         90  
> Mat2 = round(rand(2,5)*10)
 Mat2 =
        3          3          7          2          4  
        3          8          7          5          4  
> mod(Mat1,Mat2)
        2          1          2          0          1  
        1          3          6          0          2  
\end{verbatim}

\newpage



